package com.bosssoft.setp.model.system;

import xyz.erupt.annotation.Erupt;
import xyz.erupt.annotation.EruptField;
import xyz.erupt.annotation.sub_field.Edit;
import xyz.erupt.annotation.sub_field.EditType;
import xyz.erupt.annotation.sub_field.View;
import xyz.erupt.jpa.model.BaseModel;

import javax.persistence.*;
import java.util.Set;

@Erupt(name = "参数类型")
@Table(name = "setp_cs")
@Entity
public class Systemparameters extends BaseModel {
    @OneToMany(cascade = CascadeType.ALL, orphanRemoval = true) //一对多，且开启级联
    @JoinColumn(name = "this_id") //this表示当前的表名，如：order_id子表会自动创建该列来标识与主表的关系
    @OrderBy //排序
    @EruptField(
            edit = @Edit(title = "参数设置", type = EditType.TAB_TABLE_ADD)
    )
    private Set<System> tables;
    @EruptField(
            views = @View(title = "参数类型"),
            edit = @Edit(title = "参数类型", notNull = true)
    )
    private String name;

}
